package com.banciyuan.bcywebview.biz.detail.complex.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.banciyuan.bcywebview.R;
import com.banciyuan.bcywebview.base.util.BaseObserver;

import de.greenrobot.daoexample.model.Complex;

/**
 * Created by squall on 2016/8/15.
 */
public class CommentBottomHolder extends RecyclerView.ViewHolder {

    public View viewSofa;
    public View viewBlank;

    public CommentBottomHolder(View itemView) {
        super(itemView);
        viewSofa = itemView.findViewById(R.id.iv_sofa);
        viewBlank = itemView.findViewById(R.id.blankview_sofa);
    }

    public void setData(Complex complex) {
        int commentNum = complex.getReply_count();
        if (commentNum == 0) {
            viewSofa.setVisibility(View.VISIBLE);
        } else {
            viewSofa.setVisibility(View.GONE);
        }
        viewSofa.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                BaseObserver.getInstance().notifyWatchers(BaseObserver.COMMENT_EVENT, 0);
            }
        });
    }
}
